<template>
  <div>
    <bread-crumb
      class="bread-crumb-padding"
      :list="breadCrumb"
      :user="true"
    ></bread-crumb>
    <div class="user-main-box">
      <user-tab-list :list="tablist"></user-tab-list>
      <div class="form-input-area" style="position: relative">
        <Spin :withIcon="true" v-if="loading"></Spin>
        <div class="filter-line flx-row-s-c b-b-d" style="padding-left: 25px">
          <span class="f-14 c-black">
            <span class="f-14">个人认证</span>
            <span class="c-o">{{
              identityCount != null ? `（${identityCount}）` : ""
            }}</span></span
          >
          <router-link
            class="o-form-font-button f-w-600 pub-m-l-120"
            to="/user/personalc"
          >
            查看
          </router-link>
        </div>
        <div class="filter-line flx-row-s-c b-b-d" style="padding-left: 25px">
          <span class="f-14 c-black"
            ><span class="f-14">企业认证</span
            ><span class="c-o">{{
              enterpriseCount != null ? `（${enterpriseCount}）` : ""
            }}</span></span
          >
          <router-link
            class="o-form-font-button f-w-600 pub-m-l-120"
            to="/user/companyc"
          >
            查看
          </router-link>
        </div>
        <div class="filter-line flx-row-s-c b-b-d" style="padding-left: 25px">
          <span class="f-14 c-black"
            ><span class="f-14">邮箱认证</span
            ><span class="c-o">{{
              emailCount != null ? `（${emailCount}）` : ""
            }}</span></span
          >
          <router-link
            class="o-form-font-button f-w-600 pub-m-l-120"
            to="/user/emailc"
          >
            查看
          </router-link>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getMyCertificates } from "@/api/user";
export default {
  name: "VipMytemplate",
  data() {
    return {
      loading: false,
      breadCrumb: [{name: "管理中心"},{ name: "账户管理" }, { name: "我的认证" }],
      tablist: [
        {
          name: "我的认证",
          to: "/user/certification",
        },
      ],
      identityCount: null,
      enterpriseCount: null,
      emailCount: null,
    };
  },
  created() {
    this.getMyCertificates();
  },
  methods: {
    async getMyCertificates() {
      let res = await getMyCertificates();
      if (res.code == 200) {
        this.identityCount = res.data.identityCount;
        this.enterpriseCount = res.data.enterpriseCount;
        this.emailCount = res.data.emailCount;
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.tips-area {
  margin: 20px 34px 0;
}
.add-photo {
  @include size(200px, 121px);
  @include bg-setting("add-photo");
  cursor: pointer;
}
.img-display {
  @include size(200px, 121px);
  border: 1px dashed #dcdee2;
  @include bg-setting();
  position: relative;
  border-radius: 5px;
}
.img-display .delect-area {
  display: none;
}
.img-display:hover .delect-area {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background-color: #fc461e;
  @include bg-setting("cuowu", 10px 10px, center);
  transition: background-color 0.2s;
  position: absolute;
  top: 5px;
  right: 5px;
  cursor: pointer;
}
</style>
